package com.matt.order.service;

import com.matt.order.dto.PlayWithDto;
import com.matt.order.repository.PlayWithEnterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlayWithEnterService {

    @Autowired
    PlayWithEnterMapper playWithEnterMapper;

    public int playWithInfoInsert(PlayWithDto playWithDto) {
        int playWithCount = playWithEnterMapper.getCountByplayWithName(playWithDto);
        if (playWithCount > 0) {
            return 1;
        } else {
            playWithEnterMapper.playWithInfoInsert(playWithDto);
            return 0;
        }

    }

    public List<PlayWithDto> playWithInfoList() {
        return playWithEnterMapper.playWithInfoList();
    }

    public List<PlayWithDto> playGenderSUMInfoList() {
        return playWithEnterMapper.playGenderSUMInfoList();
    }

    public List<PlayWithDto> playLevelSUMInfoList() {
        return playWithEnterMapper.playLevelSUMInfoList();
    }

    public String playRollCallSUMInfo() {
        return playWithEnterMapper.playRollCallSUMInfo();
    }

    public String playEvaluateSUMInfo() {
        return playWithEnterMapper.playEvaluateSUMInfo();
    }

    public List<PlayWithDto> playSourceSUMInfoList() {
        return playWithEnterMapper.playSourceSUMInfoList();
    }
}
